﻿@model ccgstore.WebApp.ViewModels.CardVm

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<div style="display: none; position: absolute; z-index: 110; left: 400px; top: 100px; width: 15px; height: 15px" id="preview_div"></div>

<h2>Index - @Model.SelectedGame.GameName</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th>
            
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Cards.First())
        </th>
        <th>
            
        </th>
    </tr>

    @foreach (var item in Model.Cards) {
        <tr>
            <td>
                <img src="@Url.Content("~/Images/LookingGlass.png")" alt="Image" />
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.CardName)
            </td>
            <td>
                @Html.ActionLink("Edit", "Edit", new { id=item.CardId })
                @if (User.IsInRole("Admin"))
                {
                    @Html.Encode("|")
                    @Html.ActionLink("Details", "Details", new { id=item.CardId })   
                    @Html.Encode("|")
                    @Html.ActionLink("Delete", "Delete", new { id=item.CardId })           
                }           
            </td>
        </tr>
    }
</table>

<script type="text/javascript">
    //ToDo: mouseover image
    
</script>
